﻿namespace Cos.Module.Template.NHibernate.Test
{
    using Cos.Core.NHibernate;
    using Cos.Core.NHibernate.Tests;

    using NUnit.Framework;

    [TestFixture]
    public class PartDataModelModuleFixture : ModuleFixtureBase
    {
        [Test]
        public void CanMapPartDataModel()
        {
            new PersistenceSpecification<PartDataModel>(Session)
                .CheckProperty(x => x.PartName, "part name")
                .CheckProperty(x => x.PartOrder, 1)
                .CheckProperty(x => x.IsMultiCulture, false)
                .CheckProperty(x => x.IsRequired, true)
                .CheckProperty(x => x.MinValue, "0")
                .CheckProperty(x => x.MaxValue, "100")
                .CheckProperty(x => x.MinLength, 0)
                .CheckProperty(x => x.MaxLength, 100)
                .CheckProperty(x => x.CustomValidator, null)
                .CheckProperty(x => x.ThumbnailHeight, 64)
                .CheckProperty(x => x.ThumbnailWidth, 64)
                .CheckProperty(x => x.PresentationHeight, 128)
                .CheckProperty(x => x.PresentationWidth, 128)
                //.CheckReference(x => x.DataTypeId, this.DataType.Id)
                //.CheckReference(x => x.TemplateId, this.Template.Id)
                .VerifyTheMappings();
        }
    }
}
